/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react'
import {
  AppRegistry
} from 'react-native'
import Immutable from 'immutable'
import { Provider } from 'react-redux'

import configureStore from './src/store/configureStore'

// import Navigator from './src/containers/app/navigator'

import {
  // callApi,
  updateAppProps
  // upgrade,
  // toast,
} from './src/actions/app'

import App from './src/containers/app/app'

export default class navDemo extends Component {
  constructor (props) {
    super(props)
    const {
      uuid,
      version
    } = props
    this.store = configureStore({
      props: Immutable.fromJS(props)
    })

    this.store.dispatch(updateAppProps({ uuid, version }))
  }

  render () {
    return (
      <Provider store={this.store}>
        <App />
      </Provider>
    )
  }
}

AppRegistry.registerComponent('navDemo', () => navDemo)
